/*
 * lab10B4.c
 * CSIS 248 Lab #10
 */
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

#define BUFFERSIZE 32

int main() {
	char data[BUFFERSIZE];
	int fin = open( "inputf", O_RDONLY );
	int fout = open( "outputf", O_WRONLY|O_CREAT, S_IRUSR);

	int result;
	do {
		result = read( fin, data, BUFFERSIZE );
		if (result != BUFFERSIZE) break;
		result = write( fout, data, BUFFERSIZE );
	} while(result > 0);

	return 0;
}
